In [30]:
library(data.table)
In [76]:
GBD <- read.table("../Data/DALY_YLL_deaths_per_region_and_27_and_excluded_diseases_2005.txt")
GBD <- data.table(GBD)
names(GBD)
In [77]:
#Total burden per region (with excluded categories)
dg <- GBD[,list(lapply(.SD,sum),
lapply(.SD[Disease!="Injuries",],sum),
lapply(.SD[cats27==TRUE,],sum)),.SDcols=c("burden"),by=c("metr","Region")]
In [78]:
#Part of injuries among total burden per region per metric
dg$Prop_inj <- 100 - 100*as.numeric(dg$V2)/as.numeric(dg$V1)
In [79]:
#Part of excluded diseases among total burden of diseases, per region per metric
dg$Prop_excl_dis <- 100 - 100*as.numeric(dg$V3)/as.numeric(dg$V2)
In [80]:
dg[,c(1,2,6,7)]
In [81]:
#Worldwide:
dg <- GBD[,list(lapply(.SD,sum),
lapply(.SD[Disease!="Injuries",],sum),
lapply(.SD[cats27==TRUE,],sum)),.SDcols=c("burden"),by=c("metr")]
In [82]:
#Part of injuries among total burden per metric
dg$Prop_inj <- 100 - 100*as.numeric(dg$V2)/as.numeric(dg$V1)
#Part of excluded diseases among total burden of diseases per metric
dg$Prop_excl_dis <- 100 - 100*as.numeric(dg$V3)/as.numeric(dg$V2)
In [83]:
dg[,c(1,5,6)]
We create a dataframe after exclusion of disease and adding All diseases and All regions
In [84]:
GBD <- GBD[GBD$cats27==TRUE,]
In [85]:
alldis <- GBD[,lapply(.SD,sum),.SDcols="burden",by=c("metr","Region")]
alldis$Disease <- "all"
alldis <- alldis[,c(1,2,4,3)]
allreg <- GBD[,lapply(.SD,sum),.SDcols="burden",by=c("metr","Disease")]
allreg$Region <- "All"
allreg <- allreg[,c(1,4,2,3)]
In [86]:
GBD <- GBD[,c(1:4)]
In [87]:
GBD <- rbindlist(list(GBD,alldis,allreg))
In [89]:
write.table(GBD,"../Data/DALY_YLL_deaths_per_region_and_27_diseases_2005.txt")
In [ ]: